﻿//using SharpSoft.Documentation.Html.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpSoft.Documentation.Html.CSS
{
    /// <summary>
    /// Id选择器规则
    /// </summary>
    public struct IdRule:IRule
    {
        public IdRule(string id)
        {
            _Id = id;
            this._RelationType = CssSelectorRuleRelationType.And;
        }

        private string _Id;

        public string Id
        {
            get { return _Id; }
            set { _Id = value; }
        }
        private CssSelectorRuleRelationType _RelationType;
        public CssSelectorRuleRelationType RelationType
        {
            get { return _RelationType; }
            set { _RelationType = value; }
        }

        public override string ToString()
        {
            return "Id规则："+Id;
        }

        //public INodeFilter ToNodeFilter()
        //{
        //    return new AttributeRegexFilter("id", "^" + Id + "$",true);
        //}
    }
}
